Page 1 of 1
[0.17.3] Inconsistent technology/unlock-recipe behaviour
Posted: Sat Mar 02, 2019 8:16 am
by DRY411S
I note that most if not all the entities available at the start of the game are now in the technology.lua in 0.17. This was not the case in 0.16. An example is this....
Code: Select all
{
type = "technology",
name = "basic-mining",
icon_size = 128,
icon = "__base__/graphics/technology/demo/basic-mining.png",
enabled = false,
effects =
{
{
type = "unlock-recipe",
recipe = "burner-mining-drill"
},
{
type = "unlock-recipe",
recipe = "wooden-chest"
},
{
type = "unlock-recipe",
recipe = "automation-science-pack"
},
{
type = "unlock-recipe",
recipe = "iron-gear-wheel"
},
{
type = "unlock-recipe",
recipe = "stone-furnace"
},
{
type = "unlock-recipe",
recipe = "iron-plate"
},
{
type = "unlock-recipe",
recipe = "copper-plate"
}
},
unit =
{
count = 8,
ingredients = {{"automation-science-pack", 1}},
time = 1
},
order = "c-a"
},
The issue here is that the technologies are set to enabled = false even though the items are available in game. This is causing an issue in mods that rely on the technology enabled flag.
Can this be changed?
Re: [0.17.3] Technology disabled at start that should be enabled?
Posted: Sat Mar 02, 2019 9:14 am
by Klonan
I don't quite understand the issue,
Mods are reading the technology prototype incorrectly and messing things up?
What is your proposed change to the prototype?
Re: [0.17.3] Technology disabled at start that should be enabled?
Posted: Sat Mar 02, 2019 9:31 am
by DRY411S
Yes it's hard to explain.
Something's going on in the on_init handler in my mod (when a saved game is loaded for the first time with my mod).
The mod uses reset_technology_effects() in the handler
The starting items in the game weren't attached to technologies in 0.16, but are in 0.17.
I'll try and get some lower level debug information from the mod.
Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour
Posted: Sat Mar 02, 2019 10:20 am
by DRY411S
OK what's happening is this. I've changed the title of the bug report to align with what I've found:
- For every recipe my mod finds, it adds a 'recycling' recipe.
- If those recipes are unlocked by technologies, then my mod attaches my recipes to the same technologies, because I want my recipe unlocked at the same time.
- These new technologies in 0.17 like the one above are never unlocked, and therefore my mod's recipes aren't unlocked either.
- Hardcoded into the game though, the recipes in the new technologies are unlocked, even though the technology isn't.
I can workaround this, but it isn't really consistent, to have recipes that are shown as being unlocked by researching 'false' technologies, and then enabling the recipes anyway.
The force_technology_reset() is also going to produce some inconsistent behaviour, I would have thought.
Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour
Posted: Sat Mar 02, 2019 1:47 pm
by Impatient
I would like to help solve this problem, as I use your mod and want it to work properly.
I have a first question to approach this systematically:
What does
signify? That it is available for research or that it is researched or generally speaking, that it and all its recipes are available in game or ... ?
https://wiki.factorio.com/Prototype/Technology#enabled
Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour
Posted: Sat Mar 02, 2019 2:48 pm
by DRY411S
Impatient wrote: Sat Mar 02, 2019 1:47 pm
I would like to help solve this problem, as I use your mod and want it to work properly.
I have a first question to approach this systematically:
What does
signify? That it is available for research or that it is researched or generally speaking, that it and all its recipes are available in game or ... ?
https://wiki.factorio.com/Prototype/Technology#enabled
Thank you for your concern.
I have a fix in testing, but it is a workaround. And I can remove the workaround if this is accepted as a valid bug and fixed. It's just dangerous to have technologies in the game that cannot be researched, in my opinion. Other modders may have similar challenges.
Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour
Posted: Sun Mar 03, 2019 12:51 am
by Rseding91
Thanks for the report however nothing you're describing here is a bug.
- Multiple Technologies can have the same effect (unlock recipe) with any combination of enabled/disabled/researched
- A recipe can be enabled without a technology being researched that has the effect "unlock recipe"
What ever mod code you're using is simply incorrect.
Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour
Posted: Sun Mar 03, 2019 5:15 am
by DRY411S
Thank you for confirming this is working as intended. I will adjust the code in my mod.