[1.1.42] Modifying .researched resets infinite techs

Bugs that are actually features.
Post Reply
lyvgbfh
Fast Inserter
Fast Inserter
Posts: 165
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

[1.1.42] Modifying .researched resets infinite techs

Post by lyvgbfh »

Now, you may be about to say "well this is by design!", but consider the following:

Code: Select all

event.research.researched = event.research.researched
will reset the tech as well. Now that's just silly.

This is reproducible with with an attached save and mod that just runs the above code on_research_finished. Note also that the research complete notification says you've finished level zero of the tech despite that not being what was completed.
Attachments
BugReport-Technologies.zip
Save
(1.38 MiB) Downloaded 376 times
breakinfinitetechs.zip
Mod
(884 Bytes) Downloaded 376 times

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

Re: [1.1.42] Modifying .researched resets infinite techs

Post by Rseding91 »

Thanks for the report however as you already guessed: this is working correctly.

".researched" is a boolean state value of the entire technology: "has this technology been researched fully". For infinite technologies that's obviously "no". So reading it gives "false". Writing "researched" on an infinite technology to "false" resets the research level of that technology.

Essentially you don't ever want to use the value of "researched" from an infinite technology but instead a combination of ".researched" and ".level" https://lua-api.factorio.com/next/LuaTe ... logy.level
If you want to get ahold of me I'm almost always on Discord.

lyvgbfh
Fast Inserter
Fast Inserter
Posts: 165
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

Re: [1.1.42] Modifying .researched resets infinite techs

Post by lyvgbfh »

You mean setting the value of technology.researched from false to false having the effect of resetting .level is the intended behavior?

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

Re: [1.1.42] Modifying .researched resets infinite techs

Post by Rseding91 »

The previous state of .research is irrelevant to writing "false" to .researched. So, yes the way it functions is intended.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”