Page 1 of 1

SimpleItemStack to LuaItemStack

Posted: Thu Apr 13, 2017 1:18 pm
by Ranakastrasz
I need to, on item mined/robot item mined event, to look at the item prototype. It returns a Simple item Stack however, and I think I need the Lua Item Stack instead.

Re: SimpleItemStack to LuaItemStack

Posted: Thu Apr 13, 2017 1:31 pm
by prg
If you have a SimpleItemStack, you have a name. You can get at the prototype via game.item_prototypes[item_name].

Re: SimpleItemStack to LuaItemStack

Posted: Thu Apr 13, 2017 4:23 pm
by Ranakastrasz
That will help.

Thanks.
Edit:
Darvit.

Apprently while a health of zero prevents attacking it, aoe damages it, and there is no way to set the health when you pick it up, since it always says 0% even if you set health to 1.0


Guess I will have to stick with the indestructable tag via script, even if it isn't undo-able