Get the crafting speed of an assembler in script?
Get the crafting speed of an assembler in script?
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.
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.
- Attachments
-
- Untitled.png (190.09 KiB) Viewed 4642 times
Re: Get the crafting speed of an assembler in script?
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?
Code: Select all
local power = machine.electric_drain * 1800
local pollution = machine.electric_emissions * power
Re: Get the crafting speed of an assembler in script?
DaveMcW wrote:Sadly I can't find crafting speed either. Maybe you can post in modding interface requests.Code: Select all
local power = machine.electric_drain * 1800 local pollution = machine.electric_emissions * power
Maybe that is right,
Moved to interface requests
-
- Inserter
- Posts: 46
- Joined: Fri Aug 19, 2016 2:48 pm
- Contact:
Re: Get the crafting speed of an assembler in script?
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...
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?
It was added in 0.15, this thread should be moved to implemented.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Get the crafting speed of an assembler in script?
.
Last edited by bobingabout on Tue Jun 20, 2017 8:03 am, edited 1 time in total.
Re: Get the crafting speed of an assembler in script?
Code: Select all
/c game.print(game.entity_prototypes["assembling-machine-1"].crafting_speed)
-
- Inserter
- Posts: 46
- Joined: Fri Aug 19, 2016 2:48 pm
- Contact:
Re: Get the crafting speed of an assembler in script?
... gives you the base rate of all aseembling-machine-1s, not the rate of a particular assembling-machine-1 with modules and beacons.DaveMcW wrote:Code: Select all
/c game.print(game.entity_prototypes["assembling-machine-1"].crafting_speed)
Re: Get the crafting speed of an assembler in script?
Added for 0.17.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.