Page 1 of 1
How to determine if machine is running?
Posted: Wed Feb 03, 2016 3:25 pm
by Rockstar04
I am trying to make a mod that adds crude early tech speed modules that slowly do damage to the machines they are placed in. Ideally I would only like the machines to be damaged when they are running (miners mining, assembly machines assembling, etc). For assembly machines the is_crafting method is perfect, but I cant use it with mining drills.
How can I determine when a machine is actually working?
Thanks for the help everyone, this is the first time I've given LUA scripting a go, normally I just stick to making plain old new entities and item mods, so this is new for me.
Re: How to determine if machine is running?
Posted: Sat Feb 06, 2016 8:26 am
by Natha
For mining drills there is afaik no method.
Maybe the mining_state property?
Re: How to determine if machine is running?
Posted: Sat Feb 06, 2016 10:20 am
by Supercheese
It would be resource-intensive, but you could check if the crafting_progress variable has changed lately, if so then crafting has clearly happened, if it hasn't changed at all, then no crafting has happened.
Re: How to determine if machine is running?
Posted: Sat Feb 06, 2016 12:28 pm
by Natha
Supercheese wrote:It would be resource-intensive, but you could check if the crafting_progress variable has changed lately, if so then crafting has clearly happened, if it hasn't changed at all, then no crafting has happened.
That also doesnt work for mining drills.
Re: How to determine if machine is running?
Posted: Sat Feb 06, 2016 10:26 pm
by Rockstar04
Alright, this at least makes me feel better that I didn't miss something simple.
Thanks for the suggestions
Re: How to determine if machine is running?
Posted: Sat Feb 06, 2016 10:40 pm
by Supercheese
Natha wrote:Supercheese wrote:It would be resource-intensive, but you could check if the crafting_progress variable has changed lately, if so then crafting has clearly happened, if it hasn't changed at all, then no crafting has happened.
That also doesnt work for mining drills.
Wellp, there goes that idea.