Page 1 of 1

placing + setting parameters for electric-energy-interface

Posted: Tue Aug 01, 2017 7:11 pm
by someone1337
Im trying to place a electric-energy-interface from the console and set its parameters.
The idea is to add a basically infinite accumulator for an enemy force I can store store energy overproduction from the early game to be able to use it when in need, without having the ability to change the interface parameters to like make it produce energy.

The working part: Place a electric-energy-interface rom console as enemy faction to prevent changing its parameters, works.

Code: Select all

/c  game.surfaces[1].create_entity({name="electric-energy-interface", position={-10, 0}}) 
The part that i cannot seem to figure out: how do i set the parameters for the electric-energy-interface using the console?

Re: placing + setting parameters for electric-energy-interface

Posted: Tue Aug 01, 2017 7:16 pm
by Klonan
someone1337 wrote:Im trying to place a electric-energy-interface from the console and set its parameters.
The idea is to add a basically infinite accumulator for an enemy force I can store store energy overproduction from the early game to be able to use it when in need, without having the ability to change the interface parameters to like make it produce energy.

The working part: Place a electric-energy-interface rom console as enemy faction to prevent changing its parameters, works.

Code: Select all

/c  game.surfaces[1].create_entity({name="electric-energy-interface", position={-10, 0}}) 
The part that i cannot seem to figure out: how do i set the parameters for the electric-energy-interface using the console?

Code: Select all

/c  local interface = game.surfaces[1].create_entity({name="electric-energy-interface", position={-10, 0}})
  interface.electric_drain = 123456
  --Etc

Re: placing + setting parameters for electric-energy-interface

Posted: Tue Aug 01, 2017 7:32 pm
by someone1337
oh nice! Thx! <3