Hi,
I've created a unit with a negative healing_per_tick = -1
So it should only have a certain time to live.
What seems to happen though, is that once it reaches 0, it does not die, and actually becomes immortal once it reaches 0.
So, the player of player's units can kill it if they damage it before it's health reaches 0, but once it reaches 0, it can't be killed....
Once it reaches 0, I cant target it to kill...
This seems to be a bug, but I'm not entirely sure...
Any code I can provide to help out?
[0.16.51] Unit not dying when decrementing health to zero
Re: Unit not dying
You should probably report this in the bug forum.
Possible developer solutions:
- Kill unit when healing_per_tick takes HP to zero.
- healing_per_tick does not bring unit below 1 HP.
- Don't allow negative healing_per_tick
Possible developer solutions:
- Kill unit when healing_per_tick takes HP to zero.
- healing_per_tick does not bring unit below 1 HP.
- Don't allow negative healing_per_tick
Re: Unit not dying
The last is much more friendly for ups, so it will be so realized.DaveMcW wrote:You should probably report this in the bug forum.
Possible developer solutions:
- Kill unit when healing_per_tick takes HP to zero.
- healing_per_tick does not bring unit below 1 HP.
- Don't allow negative healing_per_tick
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Unit not dying
I doubt UPS cares about +1 or -1. Just kill the thing when it drops to hp <= 0.
Does on_entity_damaged trigger for self-mutilation?
Does on_entity_damaged trigger for self-mutilation?
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Unit not dying
Then every healing (negative healing) entity must be checked, if the health is 100% and if the health is ≤0.eradicator wrote:I doubt UPS cares about +1 or -1. Just kill the thing when it drops to hp <= 0.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Unit not dying
Arguing that killing an entity if the health drops below 0 being too power hungry is... pointless really.
if you could see just how complex some of these functions already are, you'd realise it already does <=0 and <=1 checks all over the place to bring them back to 0 and 1. Adding one to healing per tick isn't going to kill performance, and calling this.die() if it does drop to or below 0 should be very possible.
if you could see just how complex some of these functions already are, you'd realise it already does <=0 and <=1 checks all over the place to bring them back to 0 and 1. Adding one to healing per tick isn't going to kill performance, and calling this.die() if it does drop to or below 0 should be very possible.
Re: [0.16.51] Unit not dying when decrementing health to zero
Thanks for the report. I've changed it for 0.17 so when an entity has healing_per_tick of a negative value when it reaches 0 health it dies.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.16.51] Unit not dying when decrementing health to zero
Great!
This now allows for a strong early unit, that if you can't kill, you just have to run away, it will eventually die
Thanks.
This now allows for a strong early unit, that if you can't kill, you just have to run away, it will eventually die
Thanks.