can armor equiment have no take_result?

Place to get help with not working mods / modding interface.
Post Reply
davemcdave
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun Jun 10, 2018 1:24 pm
Contact:

can armor equiment have no take_result?

Post by davemcdave »

when i set take_result = nil, it defaults to using name of the prototype.

is there a way to have an equipment removed from an armor give no item?

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 489
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: can armor equiment have no take_result?

Post by Silari »

Setting a value to nil in LUA is how you remove it from a table, thus making Factorio use the default. Sometimes an empty string works to signify nothing, but it looks like Factorio requires equipment to have a take_result. You can work around it a bit by using the on_equipment_removed event to remove the item from the player's cursor/inventory.

Note if you just want the player to not be able to change equipment in a grid at all, there's an equipment_grid.locked property for that.

davemcdave
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun Jun 10, 2018 1:24 pm
Contact:

Re: can armor equiment have no take_result?

Post by davemcdave »

on_equipment_removed is the way.
thanks :)

Post Reply

Return to “Modding help”