Page 1 of 1

Electric belts

Posted: Mon Oct 30, 2017 1:39 am
by comwarrior
I'm trying to make a green belt twice as fast as blue belts (which i've done thanks to help) except I want to make each belt, splitter and underground consume power and has a 1 block supply area so that when you put belts in a long belt it supply's power from one end to the other.

So I thaught it might be as simple as adding the following from the power poles into entities.lua.

Code: Select all

	supply_area_distance = 2,
	radius_visualisation_picture =
    {
      filename = "__base__/graphics/entity/small-electric-pole/electric-pole-radius-visualization.png",
      width = 12,
      height = 12,
      priority = "extra-high-no-scale"
    },
	energy_source =
    {
      type = "electric",
      usage_priority = "secondary-input",
      emissions = 0.04 / 2.5
    },
    energy_usage = "10kW",
But alas, no... it seems it's not quite that simple.
Can anyone offer any advice?

Thanks

Re: Electric belts

Posted: Mon Oct 30, 2017 2:01 am
by DaveMcW
It's not simple at all. Factorio entities have very strong opinions about what they can and can't do, the only way to add functionality is to add an additional entity.

In this case you need 3 different entities (features):
transport-belt (belt movement)
electric-energy-interface (energy drain)
electric pole (power area)

Then you need a control.lua script to auto-place a hidden custom pole and custom electric-energy-interface whenever a transport belt is built/removed.
And then you need to check for power loss and disable/re-enable your belts...

Re: Electric belts

Posted: Mon Oct 30, 2017 9:14 am
by bobingabout
following on from above post...

although what you're trying to do IS possible with dummy entities and scripting...
everything in the script should probably run every single tick (Because power consumption), and that is going to ABSOLUTELY MURDER performance.

Re: Electric belts

Posted: Mon Oct 30, 2017 4:30 pm
by comwarrior
Thanks dave & Bob, much appreciated.
That is a shame, I was expecting / hoping it would be as simple as 'attaching' the necessary properties.
What about making a new subgroup so instead of using the sub group "belt" we made a new subgroup "electric belt" and thus the entities have their own options?

Re: Electric belts

Posted: Tue Oct 31, 2017 11:07 am
by bobingabout
subgroup? That's just for where in the crafting menu your recipe appears. it has no effect on the entity itself.

What you're thinking of is making a new subclass of entity, that is not possible in the base game.



What you could try though is going over to the modding interfaces requests subforum and asking if the devs can program in to make it possible for modders to make electric powered belts... but don't hold your breath, it's unlikely to happen. (Not saying it won't, but I'd put money on a bet saying they don't do it)

Re: Electric belts

Posted: Tue Oct 31, 2017 11:11 pm
by eradicator
There was a similar mod idea some time ago: 53172. The author hasn't updated the post in a while but some of my answers there might still be useful :P