Page 1 of 1

Modding Accumulators

Posted: Fri Apr 28, 2017 1:45 am
by archbishopjabber
Apologies, this is a super basic question but I know basically nothing about modding or the lua language. All I am looking to do is buff accumulators. Ideally I would like each basic accumulator to store 50 GJ rather than 5 MJ and also I would like accumulators to charge/discharge x10 faster than normal. I've messed around with the syntax and I managed to get the game not to crash when I run it but whatever garbage code I'm putting in isn't doing anything. I figured rather than suffer trying to make this work one of you would be able to give me the lines of code I need to add with little to no effort.

Re: Modding Accumulators

Posted: Fri Apr 28, 2017 10:55 am
by darkfrei
What exactly you done?

Re: Modding Accumulators

Posted: Fri Apr 28, 2017 11:44 am
by Ranakastrasz
Zip your current mod and attach it please. I would prefer to.help you learn instead of just doing it.

Re: Modding Accumulators

Posted: Fri Apr 28, 2017 2:02 pm
by archbishopjabber
Someone on reddit responded to me but the issue was that I was missing the bolded pieces of information in the text below:

data.raw["accumulator"]["accumulator"].energy_source.buffer_capacity = "50GJ"
data.raw["accumulator"]["accumulator"].energy_source.input_flow_limit = "500MW"
data.raw["accumulator"]["accumulator"].energy_source.output_flow_limit = "500MW"

I knew that it was going to be something simple like that. In the future, do you know of a good resource I can refer to if I want to make any other changes like this? Thanks for volunteering to help.

Re: Modding Accumulators

Posted: Fri Apr 28, 2017 2:33 pm
by Ranakastrasz
Well, generally, looking at the factorio data-files is enough.
data.raw["accumulator"]["accumulator"].energy_source.buffer_capacity = "50GJ"
data.raw indicates the game's base database, holding all of the objects the game has.
the first accumulator is the "Type".
the second accumulator is the name.
.energy_source is the sub-tablenamed energy_source
buffer_capacity is a variable in the subtable.