Defines for missing inventories

Post Reply
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Defines for missing inventories

Post 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 ;-)
My mods on the Factorio Mod Portal :geek:

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Defines for missing inventories

Post by Rseding91 »

I can add them. Do you know of others so I can do them all at once?
If you want to get ahold of me I'm almost always on Discord.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Defines for missing inventories

Post 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.
My mods on the Factorio Mod Portal :geek:

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Defines for missing inventories

Post by Choumiko »

The blueprint book is some kind of inventory right?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Defines for missing inventories

Post 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
If you want to get ahold of me I'm almost always on Discord.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Defines for missing inventories

Post by binbinhfr »

you have defines.inventory.mining_drill_modules
but no defines.inventory.mining_dril_output ?
My mods on the Factorio Mod Portal :geek:

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Defines for missing inventories

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Defines for missing inventories

Post 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 ?
My mods on the Factorio Mod Portal :geek:

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Defines for missing inventories

Post by Rseding91 »

I added LuaEntity::mining_target read for 0.13.10.
If you want to get ahold of me I'm almost always on Discord.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Defines for missing inventories

Post by binbinhfr »

nice !
thanks
My mods on the Factorio Mod Portal :geek:

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Defines for missing inventories

Post 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. ;)
My mods on the Factorio Mod Portal :geek:

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Defines for missing inventories

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Defines for missing inventories

Post 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 ?
My mods on the Factorio Mod Portal :geek:

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Defines for missing inventories

Post 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)
quick links: log file | graphical issues | wiki

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Defines for missing inventories

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Defines for missing inventories

Post 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.
My mods on the Factorio Mod Portal :geek:

Post Reply

Return to “Implemented mod requests”