Adding "energy_usage" to "market"

Place to get help with not working mods / modding interface.
Post Reply
hyspeed
Long Handed Inserter
Long Handed Inserter
Posts: 69
Joined: Sun Jun 05, 2016 10:18 pm
Contact:

Adding "energy_usage" to "market"

Post by hyspeed »

Hi,

I'm wanting to use the market entity as a source for a teleporter entity but have it require energy to activate.
I've created a data:extend and added some energy attributes to it, but the created entity doesn't require power.
Is there an additional attribute I need to add for it to recognize it needs power?
Or should I use a different source entity?

Code: Select all

-- teleporter is a modification of the market
local teleporter = util.table.deepcopy( data.raw["market"]["market"])
teleporter.name = "coe-teleporter"
teleporter.energy_source = {
  type = "electric",
  usage_priority = "primary-input"
}
teleporter.energy_usage = "250kW"
teleporter.active_energy_usage = "2000KW"
teleporter.destructible = false
data:extend({teleporter})
thanks

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 489
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Adding "energy_usage" to "market"

Post by Silari »

Market's don't support an energy source - you can see this in the documentation: https://wiki.factorio.com/Prototype/Market . Unless it's part of the definition adding one won't do anything. You'll have to use a different entity - lamps are a pretty common one, or accumulators if you just want something to store energy so you can remove that energy later via scripting when activated.

Post Reply

Return to “Modding help”