Variable power usage
Posted: Wed May 20, 2015 3:09 pm
Is there any way to change the amount of energy being used by a building?
Code: Select all
energy_usage = "150kW",
Oh sorry, I wasn't clear enough. Is there any way to change the energy usage dynamically, ingame?FishSandwich wrote:entities.lua"for example".Code: Select all
energy_usage = "150kW",
Quoting from the wiki here, (https://forums.factorio.com/wiki/inde ... g_overview)wahming wrote:Oh sorry, I wasn't clear enough. Is there any way to change the energy usage dynamically, ingame?FishSandwich wrote:entities.lua"for example".Code: Select all
energy_usage = "150kW",
Code: Select all
data.raw.ammo["piercing-bullet-magazine"].magazine_size = 20
Code: Select all
data.raw.assembling-machine["assembling-machine-2"].energy_usage = "300kW"
I've never been able to get that piece of code to work in control.lua or the console. Somebody told me in another thread that it's only valid if processed at game startup. Please let me know if it works for you, and how.Incinirate wrote: Quoting from the wiki here, (https://forums.factorio.com/wiki/inde ... g_overview)
Changing existing definitions:Or in your case, something like this?Code: Select all
data.raw.ammo["piercing-bullet-magazine"].magazine_size = 20
Code: Select all
data.raw.assembling-machine["assembling-machine-2"].energy_usage = "300kW"
Yeah, I guess that makes sense since all the prototypes are loaded at game startup and all their properties are stored in a C construct. Hmm, it's so frustrating that we don't have any type of interface to work with the existing prototypes, I had this same problem attempting to change a recipe at runtime.wahming wrote:I've never been able to get that piece of code to work in control.lua or the console. Somebody told me in another thread that it's only valid if processed at game startup. Please let me know if it works for you, and how.Incinirate wrote: Quoting from the wiki here, (https://forums.factorio.com/wiki/inde ... g_overview)
Changing existing definitions:Or in your case, something like this?Code: Select all
data.raw.ammo["piercing-bullet-magazine"].magazine_size = 20
Code: Select all
data.raw.assembling-machine["assembling-machine-2"].energy_usage = "300kW"