Page 1 of 1
Defines for missing inventories
Posted: Fri Jul 01, 2016 6:53 am
by binbinhfr
Hi,
I saw that you added in 0.13.2 the define for the rocket inventory.
It would be nice to have the same for other missing invenotories like the train wagon, even if using 1 usually works
Re: Defines for missing inventories
Posted: Sat Jul 02, 2016 2:48 pm
by Rseding91
I can add them. Do you know of others so I can do them all at once?
Re: Defines for missing inventories
Posted: Sat Jul 02, 2016 2:53 pm
by binbinhfr
Rseding91 wrote:I can add them. Do you know of others so I can do them all at once?
not remember another for the moment.
Re: Defines for missing inventories
Posted: Sat Jul 02, 2016 5:47 pm
by Choumiko
The blueprint book is some kind of inventory right?
Re: Defines for missing inventories
Posted: Sat Jul 02, 2016 7:01 pm
by Rseding91
Choumiko wrote:The blueprint book is some kind of inventory right?
Yes:
http://lua-api.factorio.com/0.13.3/defines.html item_main and item_active
Re: Defines for missing inventories
Posted: Thu Jul 21, 2016 8:49 am
by binbinhfr
you have defines.inventory.mining_drill_modules
but no defines.inventory.mining_dril_output ?
Re: Defines for missing inventories
Posted: Thu Jul 21, 2016 9:14 am
by Rseding91
binbinhfr wrote:you have defines.inventory.mining_drill_modules
but no defines.inventory.mining_dril_output ?
Mining drills don't have an output inventory. They have an internal energy progress bar and when that hits 100% it puts the result item(s) on the ground or in a chest in front of the entity.
Re: Defines for missing inventories
Posted: Thu Jul 21, 2016 9:19 am
by binbinhfr
Rseding91 wrote:binbinhfr wrote:you have defines.inventory.mining_drill_modules
but no defines.inventory.mining_dril_output ?
Mining drills don't have an output inventory. They have an internal energy progress bar and when that hits 100% it puts the result item(s) on the ground or in a chest in front of the entity.
Ok. Then is there a way to read the currently extracted ore (the icon that is shown in the mining drill info, at the right of the progress bar) ? Or to see if a drill is still working ?
Re: Defines for missing inventories
Posted: Thu Jul 21, 2016 9:46 am
by Rseding91
I added LuaEntity::mining_target read for 0.13.10.
Re: Defines for missing inventories
Posted: Thu Jul 21, 2016 9:51 am
by binbinhfr
nice !
thanks
Re: Defines for missing inventories
Posted: Fri Jul 22, 2016 12:18 pm
by binbinhfr
It would be nice also to have a is_mining() function, like the is_crafting(), to see if the drill is working or not.
Because for the moment, how can we test this ?
A expected_resources() function, giving back the number shown in the drill info, would be great too.
All these informations are displayed in the drill info pane, but not available in the API.
With these functions, we could really fully diagnose a drill.
Re: Defines for missing inventories
Posted: Fri Jul 22, 2016 2:46 pm
by Rseding91
binbinhfr wrote:It would be nice also to have a is_mining() function, like the is_crafting(), to see if the drill is working or not.
Because for the moment, how can we test this ?
A expected_resources() function, giving back the number shown in the drill info, would be great too.
All these informations are displayed in the drill info pane, but not available in the API.
With these functions, we could really fully diagnose a drill.
"is mining" is true if the drill exists and has ore in it's range. You can check entity.mining_progress to see how far along it is.
Expected resources isn't known by the drill. The display just guesses based off the ores in the drills area what the drill will end up mining. You can get the same effect by scanning all the ore around the drill and adding it up yourself.
Re: Defines for missing inventories
Posted: Fri Jul 22, 2016 3:12 pm
by binbinhfr
Rseding91 wrote:"is mining" is true if the drill exists and has ore in it's range.
"is mining" can be false if no electricity, or output full...
It would be nice to have it.
I was also looking for things like reading a storage tank.
Is there a way to read its content ? Or at least the name of fluid ?
Re: Defines for missing inventories
Posted: Fri Jul 22, 2016 4:48 pm
by daniel34
binbinhfr wrote:I was also looking for things like reading a storage tank.
Is there a way to read its content ? Or at least the name of fluid ?
http://lua-api.factorio.com/0.13.9/LuaFluidBox.html
Code: Select all
Name of the fluid (eg. crude-oil):
/c game.player.print(game.player.selected.fluidbox[1].type)
Amount (0..2500 for storage tanks):
/c game.player.print(game.player.selected.fluidbox[1].amount)
Re: Defines for missing inventories
Posted: Fri Jul 22, 2016 5:12 pm
by Rseding91
binbinhfr wrote:Rseding91 wrote:"is mining" is true if the drill exists and has ore in it's range.
"is mining" can be false if no electricity, or output full...
It would be nice to have it.
I was also looking for things like reading a storage tank.
Is there a way to read its content ? Or at least the name of fluid ?
The drill is still mining even in those instances. It has no "true/false" state for is mining. If there's ore in the area the drill is by definition mining.
Re: Defines for missing inventories
Posted: Sat Jul 23, 2016 2:13 pm
by binbinhfr
daniel34 wrote:Code: Select all
Name of the fluid (eg. crude-oil):
/c game.player.print(game.player.selected.fluidbox[1].type)
Amount (0..2500 for storage tanks):
/c game.player.print(game.player.selected.fluidbox[1].amount)
Thx Daniel !!!
Ok, Rseding, the new LuaEntity::mining_target is already very helpful.