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.
Re: Modding Research lab speed?
Posted: Mon Jun 02, 2014 9:48 pm
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.
Re: Modding Research lab speed?
Posted: Mon Jun 02, 2014 10:45 pm
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?
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.
Re: Modding Research lab speed?
Posted: Mon Jun 02, 2014 10:59 pm
by FreeER
probably misread what you wrote and all of this is useless
[quote="Holy-Fire"]Is it possible to change technology parameters?[/quote]Yes, there are two ways, First the 'wrong' (that I think technically works) way: If you create a tech with the same name then it would overwrite the base game's...but..not really recommended and very annoying to do for multiple techs
Better way:
you can access the data that previously loaded mods have added (like base) by accessing (and modifying) the data.raw table which I've created a nice wiki page for here (note it'll take you to the technology subtable of data.raw, but you do have access to ALL prototypes that were loaded before your mod, basically it's sorted into subtables by 'types'). The format of the tables are the exact same as what you specify when creating the prototypes (because that's where the prototypes are actually going, that's why you use data:extend({}) at the beginning of the prototype files). So to change the time for all technologies you could do something like
for _, tech in pairs(data.raw.technology) do
tech.unit.time = tech.unit.time * 2
end
Re: Modding Research lab speed?
Posted: Tue Jun 03, 2014 1:03 am
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.
Re: Modding Research lab speed?
Posted: Tue Jun 03, 2014 1:12 am
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)
Re: Modding Research lab speed?
Posted: Tue Jun 03, 2014 9:57 am
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.
Re: Modding Research lab speed?
Posted: Mon Jun 09, 2014 10:19 am
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.
Re: Modding Research lab speed?
Posted: Mon Jun 09, 2014 12:26 pm
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.
Re: Modding Research lab speed?
Posted: Mon Jun 09, 2014 4:41 pm
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.
Re: Modding Research lab speed?
Posted: Sat Jun 21, 2014 11:24 pm
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.