Modding Research lab speed?

Place to get help with not working mods / modding interface.
Post Reply
Holy-Fire
Fast Inserter
Fast Inserter
Posts: 169
Joined: Sun Apr 14, 2013 9:15 am
Contact:

Modding Research lab speed?

Post by Holy-Fire »

Is it possible to change the speed of research labs? I could find no "speed" property in the base files.

I'm trying to write a mod that slows down most aspects of the game. But I figure this could be useful, for example, for a mod that has several lab types with different speeds.

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Modding Research lab speed?

Post by FreeER »

You could probably lower the energy usage, and/or add a technology that uses the laboratory-speed modifier and try giving it a negative modifier amount, but those are both guesses, I'm not certain either would work.

Holy-Fire
Fast Inserter
Fast Inserter
Posts: 169
Joined: Sun Apr 14, 2013 9:15 am
Contact:

Re: Modding Research lab speed?

Post by Holy-Fire »

FreeER wrote:You could probably lower the energy usage
This idea crossed my mind as well but I thought for sure it wouldn't work... But it turns out it does!

Using this upsets the balance a bit (since for other buildings I'm keeping the same power consumption), but labs aren't a big power consumer anyway.


I do have another question though: One of things I tried is to loop over all technologies and increase the time it takes to research them. However, it seemed that once the technologies are defined in the base, they're immutable and can't be changed - any assignment I made had no effect. Is it possible to change technology parameters?

JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

Re: Modding Research lab speed?

Post by JamesOFarrell »

Code: Select all

game.player.force.resettechnologies()
game.player.force.resetrecipes()
game.reloadscript()
This might work. It is designed to be used in amigration script but may work outside of it. Look at the Lua/Force wiki page for more info: https://forums.factorio.com/wiki/inde ... =Lua/Force

Holy-Fire
Fast Inserter
Fast Inserter
Posts: 169
Joined: Sun Apr 14, 2013 9:15 am
Contact:

Re: Modding Research lab speed?

Post by Holy-Fire »

JamesOFarrell wrote:

Code: Select all

game.player.force.resettechnologies()
game.player.force.resetrecipes()
game.reloadscript()
This might work. It is designed to be used in amigration script but may work outside of it. Look at the Lua/Force wiki page for more info: https://forums.factorio.com/wiki/inde ... =Lua/Force
Thanks! That's what I was missing. I loaded a saved game to do experimentations, I needed to start fresh or else run these commands.

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Modding Research lab speed?

Post by FreeER »

probably misread what you wrote and all of this is useless

JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

Re: Modding Research lab speed?

Post by JamesOFarrell »

FreeER wrote:probably misread what you wrote and all of this is useless
I read it and found it quiet useful. Thanks FreeER.

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Modding Research lab speed?

Post by FreeER »

JamesOFarrell wrote:I read it and found it quiet useful. Thanks FreeER.
Oh good, I didn't waste my time then :) Glad you found it helpful, I thought about deleting it but figured that it was possible for someone who didn't know to find it (but I still put it in a spoiler since it doesn't directly solve Holy-Fire's problem lol)

Holy-Fire
Fast Inserter
Fast Inserter
Posts: 169
Joined: Sun Apr 14, 2013 9:15 am
Contact:

Re: Modding Research lab speed?

Post by Holy-Fire »

FreeER wrote:
JamesOFarrell wrote:I read it and found it quiet useful. Thanks FreeER.
Oh good, I didn't waste my time then :) Glad you found it helpful, I thought about deleting it but figured that it was possible for someone who didn't know to find it (but I still put it in a spoiler since it doesn't directly solve Holy-Fire's problem lol)
Yes, that's a good reference but the part about looping through all technologies I figured out independently, I was missing reloading the new definitions in an already running game.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Modding Research lab speed?

Post by bobingabout »

You've gone through this huge convoluted process here.

I cloned the lab, and added the tag "crafting_speed = 2," and it seems to work.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Rensiur
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Sat May 17, 2014 2:41 pm
Contact:

Re: Modding Research lab speed?

Post by Rensiur »

I'd say cloning is a way, yet the less "clean" solution as it adds another item eventually.

The way that has been described above is interesting as you can basically affect everything that has to deal with recipes, even the ones that are done in special labs like DyTech I guess.

Holy-Fire
Fast Inserter
Fast Inserter
Posts: 169
Joined: Sun Apr 14, 2013 9:15 am
Contact:

Re: Modding Research lab speed?

Post by Holy-Fire »

bobingabout wrote:You've gone through this huge convoluted process here.

I cloned the lab, and added the tag "crafting_speed = 2," and it seems to work.
Interesting, thanks.

Holy-Fire
Fast Inserter
Fast Inserter
Posts: 169
Joined: Sun Apr 14, 2013 9:15 am
Contact:

Re: Modding Research lab speed?

Post by Holy-Fire »

bobingabout wrote:You've gone through this huge convoluted process here.

I cloned the lab, and added the tag "crafting_speed = 2," and it seems to work.
Are you sure this works? I tried adding the tag to the lab and it had no effect.

Post Reply

Return to “Modding help”