Control.lua

Place to get help with not working mods / modding interface.
User avatar
mat1k
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Dec 22, 2018 8:48 am
Contact:

Control.lua

Post by mat1k »

Is there a way to get the resistance values from an entity when it is placed? and if possible alter them.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Control.lua

Post by eradicator »

You can read them.
https://lua-api.factorio.com/latest/Lua ... esistances
game.entity_prototypes[entity_name].prototype.resistances
entity.prototype.resistances

But changing is only possible in data stage.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Post Reply

Return to “Modding help”