[Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

This subforum contains all the issues which we already resolved.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

[Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

Post by eradicator »

Reproduction:
  1. Take any buildable item stack (furnace, chest, w/e)
  2. Apply /c game.player.cursor_stack.health = 0
  3. Placed entity will have 0/MAX health and thus be indestructible.
Expected behavior:
I guess stacks with 0% health should be blocked from being built? Plain out deleting them could break mods (i.e. if they supply other means of repairing items).
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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 14138
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

Post by Rseding91 »

Thanks for the report. I see 3 "ok" options:

1. I disallow 0% health items
2. I make entities built with 0% health instant die
3. I do nothing and leave it as is

Adding in extra logic to prevent building with 0% health items just isn't viable. Because it would also have to be done for robots and then you would wonder "why is the robot not using this item to build" and the logistic network has no concept of item health so it would never know to *not* use a given item. It's just overly complicated for such a minor issue.
If you want to get ahold of me I'm almost always on Discord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

Post by eradicator »

"2) instant death" in combination with construction robots sounds like the worst option - they'd build something and it instantly explodes and becomes a ghost again.

"1)" makes the most logical sense, but what would happen instead? error if health=0 but ok if health=0.000000001?

I'd be fine with "3)" too, at least it's documented now for future reference.

What about 4): Any new building has at least 1 health - which is what already happens if the stack has 0.000000001 health.
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.

User avatar
valneq
Smart Inserter
Smart Inserter
Posts: 1243
Joined: Fri Jul 12, 2019 7:43 am
Contact:

Re: [Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

Post by valneq »

eradicator wrote:
Fri Feb 07, 2020 7:20 pm
What about 4): Any new building has at least 1 health - which is what already happens if the stack has 0.000000001 health.
+1 for option 4.

This is what I would expect as a naive user. For the normal user it is not possible to differentiate a stack with 0 health or with 0.000000001 health, since the only indicator (that I am aware of) is the green health bar. Getting a stack with exactly 0 health without scripting or modding is yet another issue. But once you have them, finding their behavior to be different (instant destruction vs. construction with 1 hitpoint) can be very confusing.

Rseding91
Factorio Staff
Factorio Staff
Posts: 14138
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

Post by Rseding91 »

I would also be ok with giving the entity 1 health minimum. Or leaving it as is; either's fine with me.
If you want to get ahold of me I'm almost always on Discord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

Post by eradicator »

Rseding91 wrote:
Fri Feb 07, 2020 8:28 pm
giving the entity 1 health minimum.
I prefer that. It prevents the player from manually building entities in "weird" states while not preventing (breaking) mods from doing it anyway if they really want to.
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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 14138
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

Post by Rseding91 »

Ok, I changed it for the next release. Now entities built from items will always have a minimum of 1 health.
If you want to get ahold of me I'm almost always on Discord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [Rseding] [0.18.2] (Minor) Item stack with 0% health builds indestructible entities.

Post by eradicator »

Thanks for the fix.
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.

Post Reply

Return to “Resolved Problems and Bugs”