https://mods.factorio.com/mod/DelayedRegen
Tired of biters/nests healing faster than you do damage? TIRED OF BURNING SO MANY BULLETS? Delay regeneration until they're out of combat!
Tested for a few minutes in multiplayer with someone else. Seems save/load stable with no errors in log. I might be doing overkill on some safeties so if someone has a big biter map at the moment I'd appreciate you trying it out for safety and performance reasons.
[0.17] Delayed Regeneration
[0.17] Delayed Regeneration
I have mods! I guess!
Link
Link
Re: [0.17] Delayed Regeneration
Nice idea.Honktown wrote: Tue Dec 10, 2019 11:16 am https://mods.factorio.com/mod/DelayedRegen
Tired of biters/nests healing faster than you do damage? TIRED OF BURNING SO MANY BULLETS? Delay regeneration until they're out of combat!
Tested for a few minutes in multiplayer with someone else. Seems save/load stable with no errors in log. I might be doing overkill on some safeties so if someone has a big biter map at the moment I'd appreciate you trying it out for safety and performance reasons.
I would encourage the devs to try it out if this could be a vanilla play style to make combat great again.
If not - fine.
Re: [0.17] Delayed Regeneration
Not bad for one of your first mods.
A lot of room for improvement - but don't worry, you'll always do it better the second time.
One area is where you're comparing strings in an on_tick function (heal_effect) and tick timers on all entries in a table.
You can save the expensive detour through on_tick by using on_nth_tick instead.
Don't forget that you need to have the data stored in global so you can recreate "future" on_nth_tick calls in on_load, as these are not stored between save/loads.
And something fun - your settings could be changed during runtime by using https://lua-api.factorio.com/latest/eve ... ng_changed
And yes it is usually better to setup your mods global table with on_init and on_configuration_changed.
on_load only has 4 specific uses, and on_nth_tick is one of them.
A lot of room for improvement - but don't worry, you'll always do it better the second time.
One area is where you're comparing strings in an on_tick function (heal_effect) and tick timers on all entries in a table.
You can save the expensive detour through on_tick by using on_nth_tick instead.
Don't forget that you need to have the data stored in global so you can recreate "future" on_nth_tick calls in on_load, as these are not stored between save/loads.
And something fun - your settings could be changed during runtime by using https://lua-api.factorio.com/latest/eve ... ng_changed
And yes it is usually better to setup your mods global table with on_init and on_configuration_changed.
on_load only has 4 specific uses, and on_nth_tick is one of them.
Re: [0.17] Delayed Regeneration
Originally I was planning to have every enemy heal separately, instead of on the same tick. I added comments about the conflicting time, since technically the heal amount is wrong on the first healing pass of an enemy. There's different ways of implementing when to heal - I could've used a delay multiple counter and decrement it every delay until it reaches 0, then start healing an enemy, or just record the delay and decrement ticks until 0.PyroFire wrote: Tue Dec 10, 2019 4:53 pm Not bad for one of your first mods.
A lot of room for improvement - but don't worry, you'll always do it better the second time.
One area is where you're comparing strings in an on_tick function (heal_effect) and tick timers on all entries in a table.
You can save the expensive detour through on_tick by using on_nth_tick instead.
Don't forget that you need to have the data stored in global so you can recreate "future" on_nth_tick calls in on_load, as these are not stored between save/loads.
And something fun - your settings could be changed during runtime by using https://lua-api.factorio.com/latest/eve ... ng_changed
And yes it is usually better to setup your mods global table with on_init and on_configuration_changed.
on_load only has 4 specific uses, and on_nth_tick is one of them.
I can also define the heal function based on setting, instead of doing a check at all in a single function. More of an object-oriented style. I shat this mod out in a few hours, and I wanted to be the first to do it. Since it worked well, I got it out before cleaning it up a lot.
If you want to see more of a god-awful mess, DeepPockets is so much worse on the backside.
I have mods! I guess!
Link
Link
Re: [0.17] Delayed Regeneration
We already discussed this with them, because a 50% bonus to 7.5 damage doesn't kill a biter in 2 hits - they heal like .1 health in the time it takes to fire. They said no.steinio wrote: Tue Dec 10, 2019 4:12 pmNice idea.Honktown wrote: Tue Dec 10, 2019 11:16 am https://mods.factorio.com/mod/DelayedRegen
Tired of biters/nests healing faster than you do damage? TIRED OF BURNING SO MANY BULLETS? Delay regeneration until they're out of combat!
Tested for a few minutes in multiplayer with someone else. Seems save/load stable with no errors in log. I might be doing overkill on some safeties so if someone has a big biter map at the moment I'd appreciate you trying it out for safety and performance reasons.
I would encourage the devs to try it out if this could be a vanilla play style to make combat great again.
If not - fine.
I have mods! I guess!
Link
Link