Page 1 of 1

Get the crafting speed of an assembler in script?

Posted: Thu Sep 29, 2016 3:25 am
by spworwell
Where can I find the underlined properties in the information available to an executing mod?
It's in the raw data, but data.raw doesn't seem to be accessible from config.lua anywhere in the lifecycle
I also can't find enough information in the entity and item prototypes to reconstruct it.

Re: Get the crafting speed of an assembler in script?

Posted: Mon Oct 03, 2016 12:59 am
by spworwell
bump

Re: Get the crafting speed of an assembler in script?

Posted: Mon Oct 03, 2016 1:48 am
by DaveMcW

Re: Get the crafting speed of an assembler in script?

Posted: Tue Oct 04, 2016 1:39 am
by spworwell
thanks Dave, but that property is only available on Modules, so it doesn't tell me what the base crafting speed or energy cost of an assembler, and I can't figure out the base + module values w/o knowing the base values.

Re: Get the crafting speed of an assembler in script?

Posted: Tue Oct 04, 2016 8:07 pm
by DaveMcW

Code: Select all

local power = machine.electric_drain * 1800
local pollution = machine.electric_emissions * power
Sadly I can't find crafting speed either. Maybe you can post in modding interface requests.

Re: Get the crafting speed of an assembler in script?

Posted: Tue Oct 04, 2016 8:44 pm
by Klonan
DaveMcW wrote:

Code: Select all

local power = machine.electric_drain * 1800
local pollution = machine.electric_emissions * power
Sadly I can't find crafting speed either. Maybe you can post in modding interface requests.

Maybe that is right,

Moved to interface requests

Re: Get the crafting speed of an assembler in script?

Posted: Tue Jun 13, 2017 9:45 pm
by Theanderblast
I'd like this too. I"m thinking of a mod that adds a selection tool where you select a bunch of assemblers (for example) and it tells you the maximum rate of consumption and production they currently could do, in items per second (or minute), based on the modules it has, the beacon effects it's getting, the assembler's crafting speed.

There are mods which tell you what machines are currently producing/consuming, but not the max possible rates.

I'm wondering if the OP has the same idea I do... :)

Re: Get the crafting speed of an assembler in script?

Posted: Wed Jun 14, 2017 4:08 am
by DaveMcW
It was added in 0.15, this thread should be moved to implemented.

Re: Get the crafting speed of an assembler in script?

Posted: Wed Jun 14, 2017 7:53 am
by bobingabout
.

Re: Get the crafting speed of an assembler in script?

Posted: Fri Jun 16, 2017 1:25 am
by DaveMcW

Code: Select all

/c game.print(game.entity_prototypes["assembling-machine-1"].crafting_speed)

Re: Get the crafting speed of an assembler in script?

Posted: Fri Jun 16, 2017 3:49 pm
by Theanderblast
DaveMcW wrote:

Code: Select all

/c game.print(game.entity_prototypes["assembling-machine-1"].crafting_speed)
... gives you the base rate of all aseembling-machine-1s, not the rate of a particular assembling-machine-1 with modules and beacons.

Re: Get the crafting speed of an assembler in script?

Posted: Thu Jun 21, 2018 3:27 pm
by Bilka
Added for 0.17.