[0.17.79] game.player.force.reset_technology_effects() unlocks technologies

This subforum contains all the issues which we already resolved.
Post Reply
Honktown
Filter Inserter
Filter Inserter
Posts: 695
Joined: Thu Oct 03, 2019 7:10 am
Contact:

[0.17.79] game.player.force.reset_technology_effects() unlocks technologies

Post by Honktown »

I'm playing with a mod NonWaveDefense, which has some bad behavior which doesn't load bonus effects properly on loading a save.

I modded in a command locally which resets technology effects and then applies wave defense bonuses, which worked fine, until I used it in Warptorio2 expansion.

Using game.player.force.reset_technology_effects() unlocked all the technologies, which normally have to be unlocked by progressing through missions. I don't know if "unlocked" is the right word, they're present in the tech tree, but the background is transparent (neither red nor green) until the proper mission is completed (or item used).

https://lua-api.factorio.com/latest/Lua ... gy_effects
Reapplies all possible research effects, including unlocked recipes. Any custom changes are lost. Preserves research state of technologies.
That doesn't sound like it should alter the red/green/transparent state of research.

Edit: Sorry for the bad title. I have the command proper, above.
Last edited by Honktown on Thu Jan 16, 2020 8:21 pm, edited 1 time in total.
I have mods! I guess!
Link

Honktown
Filter Inserter
Filter Inserter
Posts: 695
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [17.79] game.force.player.reset_technology_effects() unlocks recipes

Post by Honktown »

Resetting technology effects also sets the visible_when_disabled to false.

A messy workaround was to store+log the disabled techs, and then ones which were disabled and visible when disabled, and then re-assign their status after resetting, via console.
I have mods! I guess!
Link

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

Re: [17.79] game.force.player.reset_technology_effects() unlocks recipes

Post by Rseding91 »

I think the description might just be wrong. Part of the refresh is applying each unlocked recipes effects - of which some may have "enable recipe" which does exactly what you would think: researching that technology unlocks the recipe.

I don't see how any other way would make sense. If it doesn't unlock recipes that technologies say they should unlock then it doesn't do what it says it should do.
If you want to get ahold of me I'm almost always on Discord.

Honktown
Filter Inserter
Filter Inserter
Posts: 695
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [17.79] game.force.player.reset_technology_effects() unlocks recipes

Post by Honktown »

Rseding91 wrote:
Thu Jan 16, 2020 4:09 pm
I think the description might just be wrong. Part of the refresh is applying each unlocked recipes effects - of which some may have "enable recipe" which does exactly what you would think: researching that technology unlocks the recipe.

I don't see how any other way would make sense. If it doesn't unlock recipes that technologies say they should unlock then it doesn't do what it says it should do.
Warptorio2 Expansion's technologies don't enable the subsequent technologies when researched, only a control.lua function explicitly does. It also doesn't explain why visible_when_disabled is modified, as that's not a listed modifier nor is it present in warptorio2 or warptorio2 expansion.

The problem [in my opinion] is likely the reset_technology_effects resets the prototype and applies the prototypes effects, which isn't the same as resetting modifier effects and applying currently researched technology effects in the force. Warptorio2 Expansion disables and hides technologies via a control effect, not by re-defining the prototypes.
I have mods! I guess!
Link

Honktown
Filter Inserter
Filter Inserter
Posts: 695
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [17.79] game.force.player.reset_technology_effects() unlocks recipes

Post by Honktown »

Damnit, I misdid recipes as technologies in the title. REALLY sorry for that confusion, had recipe stuff on my mind all day. Corrected.
I have mods! I guess!
Link

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

Re: [0.17.79] game.player.force.reset_technology_effects() unlocks technologies

Post by Rseding91 »

Ok, it's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”

Who is online

Users browsing this forum: sorahn, Uthrom