SimpleItemStack to LuaItemStack

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2129
Joined: Thu Jun 12, 2014 3:05 am
Contact:

SimpleItemStack to LuaItemStack

Post 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.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: SimpleItemStack to LuaItemStack

Post by prg »

If you have a SimpleItemStack, you have a name. You can get at the prototype via game.item_prototypes[item_name].
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2129
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: SimpleItemStack to LuaItemStack

Post 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
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Post Reply

Return to “Modding help”