Burner inventory validity for different entities

This subforum contains all the issues which we already resolved.
User avatar
garrotte
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Mar 10, 2020 5:10 pm
Contact:

Burner inventory validity for different entities

Post by garrotte »

Hello,
A small request. Make burner inventory for new entities valid in game API.
I created radar with burner energy source. It works fine, player or inserter can put fuel inside and it burns -> consumes energy, scans chunks...
But it doesn't allow to do anything with its inventory (e.g. get items count or insert fuel) in mod script. Burner inventory validity check always returns false. And if this check is skipped then error occurs about burner inventory currently being not valid. I tried to give entity some time to maybe finish initiating burner, but its inventory always remains invalid, even after player puts some fuel.
Tried to fuel stone-furnace via script - works fine, its burner inventory is always valid.

Excuse me if I put this request in wrong thread.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14339
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Burner inventory validity for different entities

Post by Rseding91 »

I think you might want to post in modding help. I tried what you said and it all works correctly for me:
Untitled.png
Untitled.png (1001.13 KiB) Viewed 2817 times
If you want to get ahold of me I'm almost always on Discord.
User avatar
garrotte
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Mar 10, 2020 5:10 pm
Contact:

Re: Burner inventory validity for different entities

Post by garrotte »

Hello Rseding91,
But... you did it not how API documentation describes it.
I replaced getting burner inventory with your example and mod started to work as it should.
Thank you!

P.S.
API documentation way (and it works, but only with default game entities) for your example will be:
global f = game.player.selected.burner.inventory
game.print(global.f.valid)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14339
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Burner inventory validity for different entities

Post by Rseding91 »

Ahh ok, so that's a bug that needs to be fixed.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”