Making belt prototype consume power
Making belt prototype consume power
Hi!
I'm trying to create a custom transport belt entity that will draw power from the grid. But I've had no luck so far with getting the belt to connect to the grid. Can anybody advise?
I'm trying to create a custom transport belt entity that will draw power from the grid. But I've had no luck so far with getting the belt to connect to the grid. Can anybody advise?
-
- Burner Inserter
- Posts: 18
- Joined: Sun May 03, 2015 9:50 pm
- Contact:
Re: Making belt prototype consume power
Possibly something like this in the entity code, not tested though so I can't say for certain:wahming wrote:Hi!
I'm trying to create a custom transport belt entity that will draw power from the grid. But I've had no luck so far with getting the belt to connect to the grid. Can anybody advise?
Code: Select all
energy_source = {
type = "electric",
-- will produce this much * energy pollution units per tick
emissions = 0.15 / 1.5,
usage_priority = "secondary-input"
},
energy_usage = "90kW",
Re: Making belt prototype consume power
I thought so too. Sadly no, I already tried that.Incinirate wrote:Possibly something like this in the entity code, not tested though so I can't say for certain:wahming wrote:Hi!
I'm trying to create a custom transport belt entity that will draw power from the grid. But I've had no luck so far with getting the belt to connect to the grid. Can anybody advise?Code: Select all
energy_source = { type = "electric", -- will produce this much * energy pollution units per tick emissions = 0.15 / 1.5, usage_priority = "secondary-input" }, energy_usage = "90kW",
Re: Making belt prototype consume power
I don't understand, yours belts are using electricity but you need connect eeeevery belt with a pole?wahming wrote:I'm trying to create a custom transport belt entity that will draw power from the grid. But I've had no luck so far with getting the belt to connect to the grid. Can anybody advise?
-
- Burner Inserter
- Posts: 18
- Joined: Sun May 03, 2015 9:50 pm
- Contact:
Re: Making belt prototype consume power
I'm sorry, maybe I am not understanding correctly, do the poles connect to the belts with that code and they just don't stop when you remove power or do they not connect alltogether?wahming wrote:--snip--
I thought so too. Sadly no, I already tried that.
Re: Making belt prototype consume power
L0771 wrote:I don't understand, yours belts are using electricity but you need connect eeeevery belt with a pole?wahming wrote:I'm trying to create a custom transport belt entity that will draw power from the grid. But I've had no luck so far with getting the belt to connect to the grid. Can anybody advise?
No, my belts are not using electricity, and they are not connecting at all.Incinirate wrote:I'm sorry, maybe I am not understanding correctly, do the poles connect to the belts with that code and they just don't stop when you remove power or do they not connect alltogether?wahming wrote:--snip--
I thought so too. Sadly no, I already tried that.
Re: Making belt prototype consume power
It's not currently possible to make belts use power through the prototype - the belt entity doesn't support it.
You could possibly do it through scripting but it wouldn't be efficient by any means.
You could possibly do it through scripting but it wouldn't be efficient by any means.
If you want to get ahold of me I'm almost always on Discord.
Re: Making belt prototype consume power
Yeah, I thought so. Thanks anyway for confirming.Rseding91 wrote:It's not currently possible to make belts use power through the prototype - the belt entity doesn't support it.
Just for me to learn - how would I do that?Rseding91 wrote:You could possibly do it through scripting but it wouldn't be efficient by any means.
-
- Burner Inserter
- Posts: 18
- Joined: Sun May 03, 2015 9:50 pm
- Contact:
Re: Making belt prototype consume power
You could check it the belt was in range of any pole that was connected to power, if so, drain power, and if not set the belts speed to 0. Possiblywahming wrote:Yeah, I thought so. Thanks anyway for confirming.Rseding91 wrote:It's not currently possible to make belts use power through the prototype - the belt entity doesn't support it.
Just for me to learn - how would I do that?Rseding91 wrote:You could possibly do it through scripting but it wouldn't be efficient by any means.
Re: Making belt prototype consume power
You can't set belts speed to 0 - entity prototype can't be modified.Incinirate wrote:You could check it the belt was in range of any pole that was connected to power, if so, drain power, and if not set the belts speed to 0. Possiblywahming wrote:Yeah, I thought so. Thanks anyway for confirming.Rseding91 wrote:It's not currently possible to make belts use power through the prototype - the belt entity doesn't support it.
Just for me to learn - how would I do that?Rseding91 wrote:You could possibly do it through scripting but it wouldn't be efficient by any means.
You could consume power per belt in pole range but you couldn't stop the belt itself from working.
Re: Making belt prototype consume power
Belts can be deactivated - I've already got that working in my proof of concept. My major headache is with getting them to consume power.orzelek wrote:You can't set belts speed to 0 - entity prototype can't be modified.Incinirate wrote:You could check it the belt was in range of any pole that was connected to power, if so, drain power, and if not set the belts speed to 0. Possiblywahming wrote:Yeah, I thought so. Thanks anyway for confirming.Rseding91 wrote:It's not currently possible to make belts use power through the prototype - the belt entity doesn't support it.
Just for me to learn - how would I do that?Rseding91 wrote:You could possibly do it through scripting but it wouldn't be efficient by any means.
You could consume power per belt in pole range but you couldn't stop the belt itself from working.
Re: Making belt prototype consume power
You could look at how I implemented power usage for the chests in my "Compression Chests" mod - it's not perfect but it works great for the purposes of that mod. https://github.com/Rseding91/Compression-Chestswahming wrote: ... Belts can be deactivated - I've already got that working in my proof of concept. My major headache is with getting them to consume power.
If you want to get ahold of me I'm almost always on Discord.
Re: Making belt prototype consume power
Glancing through your code - so you create a custom pole that has to be placed near your chest, and drain power from that? Good idea. I can see how to modify it for my own use.Rseding91 wrote:You could look at how I implemented power usage for the chests in my "Compression Chests" mod - it's not perfect but it works great for the purposes of that mod. https://github.com/Rseding91/Compression-Chestswahming wrote: ... Belts can be deactivated - I've already got that working in my proof of concept. My major headache is with getting them to consume power.
Edit: Does the power usage show up in the electrical overview?
Edit 2: Nvm, I realised it's based on the accumulator prototype, not electric pole as I thought.