Page 1 of 1

Burner inventory validity for different entities

Posted: Sun Jan 16, 2022 10:09 am
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.

Re: Burner inventory validity for different entities

Posted: Sun Jan 16, 2022 5:13 pm
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 3144 times

Re: Burner inventory validity for different entities

Posted: Sun Jan 16, 2022 9:08 pm
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)

Re: Burner inventory validity for different entities

Posted: Sun Jan 16, 2022 9:50 pm
by Rseding91
Ahh ok, so that's a bug that needs to be fixed.