Making trees stronger the farther they are from the spawn point
Posted: Sat Oct 26, 2019 5:02 pm
I'm trying to make a mod that makes trees stronger the further they are from the spawn point. Ideally it would change `max_health`, but that's not available on the fly. The next approach I thought of is to set `max_health` to a high amount and scale `health` with distance. I don't want the trees to heal, so I tried to use this code in data-updates.lua:
But it didn't seem to have any effect. The trees still heal. I tried setting `healing_per_tick` to other values to see what would happen. Nothing I set it to had any effect on the healing speed.
Is there something I'm doing wrong?
Is there a better way to do what I want to do?
Code: Select all
for _, tree in pairs(data.raw.tree) do
--make trees stonger
tree.max_health = 1000000
tree.healing_per_tick = 0
end
Is there something I'm doing wrong?
Is there a better way to do what I want to do?