question about healing_per_tick

Place to get help with not working mods / modding interface.
Post Reply
rabmuk
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Jun 02, 2024 2:18 pm
Contact:

question about healing_per_tick

Post by rabmuk »

I'm trying to make a building that decays over time. That once it's placed, it loses health automatically

I tried

Code: Select all

local dungeon_assembler_entity = table.deepcopy(data.raw["assembling-machine"]["assembling-machine-1"])
dungeon_assembler_entity.healing_per_tick = -1
and nothing

So then I tired

Code: Select all

local dungeon_assembler_entity = table.deepcopy(data.raw["assembling-machine"]["assembling-machine-1"])
dungeon_assembler_entity.healing_per_tick = 1
and after shooting it with my pistol it wouldn't heal.

I looked at the code in ModMash Splinter, Regenerative Tech https://mods.factorio.com/mod/modmashsp ... generative

I was hoping to avoid running an extra function that checks and changes building's health. It seems like that mod adds all buildings to a list and loops through them.

The documentation for healing_per_tick says: "The entity must be active for this to work". What does that mean?

Pi-C
Smart Inserter
Smart Inserter
Posts: 1698
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: question about healing_per_tick

Post by Pi-C »

rabmuk wrote:
Sun Jun 02, 2024 2:29 pm
The documentation for healing_per_tick says: "The entity must be active for this to work". What does that mean?
See here:
Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc).

Entities that are not active naturally can't be set to be active (setting it to be active will do nothing)

Ghosts, simple smoke, and corpses can't be modified at this time.

It is even possible to set the character to not be active, so he can't move and perform most of the tasks.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding help”