Page 1 of 1

Tree pollution-damage, color variant, and more

Posted: Tue Jul 25, 2017 1:12 am
by Reika
Exactly as it sounds, various tree parameters:

* The damage state of a tree from pollution, so it can be healed (the map-settings imply this happens automatically, but I have never seen it actually happen, despite real-world days of zero pollution).

* Which "variant" of the entity it is (not all trees with the same entity name look the same, being rotated and colored differently)

Re: Tree pollution-damage, color variant, and more

Posted: Thu May 23, 2019 2:31 pm
by Bilka
I added LuaEntity::tree_stage_index for the next version, the variant can already be read/set using https://lua-api.factorio.com/latest/Lua ... _variation.

Re: Tree pollution-damage, color variant, and more

Posted: Fri Jun 07, 2019 5:55 am
by Reika
That does not really address my needs; I need the ability to basically perfectly clone a tree.

Re: Tree pollution-damage, color variant, and more

Posted: Fri Jun 07, 2019 6:47 am
by Bilka
You can read and set the variant, color index and the "pollution damage" as you call it, what is missing to clone the tree?

Re: Tree pollution-damage, color variant, and more

Posted: Fri Jun 07, 2019 2:45 pm
by Reika
Bilka wrote: Fri Jun 07, 2019 6:47 am You can read and set the variant, color index and the "pollution damage" as you call it, what is missing to clone the tree?
Your linked parameters make no mention of pollution damage.

Re: Tree pollution-damage, color variant, and more

Posted: Fri Jun 07, 2019 2:49 pm
by Bilka
Reika wrote: Fri Jun 07, 2019 2:45 pm Your linked parameters make no mention of pollution damage.
Bilka wrote: Thu May 23, 2019 2:31 pm I added LuaEntity::tree_stage_index for the next version
That's the same thing

Re: Tree pollution-damage, color variant, and more

Posted: Fri Jun 07, 2019 2:55 pm
by Reika
Bilka wrote: Fri Jun 07, 2019 2:49 pm
Reika wrote: Fri Jun 07, 2019 2:45 pm Your linked parameters make no mention of pollution damage.
Bilka wrote: Thu May 23, 2019 2:31 pm I added LuaEntity::tree_stage_index for the next version
That's the same thing
...How would I be supposed to know this? I really recommend changing the name to something descriptive of its actual function.

Re: Tree pollution-damage, color variant, and more

Posted: Fri Jun 07, 2019 2:59 pm
by Bilka
It's actual function is reading the tree stage. Trees can/could spawn with different stages depending on the tree richness setting, so naming it something related to pollution would be wrong. If you browse the wiki, you will find that we also call it stage on there, so it should be obvious enough for most users.

Re: Tree pollution-damage, color variant, and more

Posted: Fri Jun 07, 2019 3:10 pm
by Reika
Bilka wrote: Fri Jun 07, 2019 2:59 pm It's actual function is reading the tree stage. Trees can/could spawn with different stages depending on the tree richness setting, so naming it something related to pollution would be wrong. If you browse the wiki, you will find that we also call it stage on there, so it should be obvious enough for most users.
In that case there should be some mention on the documentation that this is also pollution damage, because Ctrl-F for "pollution" coming up with zero results makes the user not dig deeper.