I would like to know how to work with next example.
I making some turrets and one of them combined rocket and cannon turret
1. make a ammo chest
2. Insert Items
3. if not ammo, not insert / if ammo, insert
I think get chest inventory entity and if if... end end.
But have a problem! ammo entity name is too many.
So try to classified into categories.
Unfortunately I can't search that code..
Do you know how I get ammo category(bullet/ shotgun-shell/ cannon-shell/ rocket/ capsule/ ...) in ammo chest???
Or selected entity name only?
I have question [get_inventory]
Re: I have question [get_inventory]
Code: Select all
/c
for name, item in pairs(game.item_prototypes) do
if item.type == "ammo" then
game.player.print("name : " .. name)
end
end