Currently we have access to on_entity_died, but cannot access the corpse of the entity until after that function completes.
It would be ideal to be able to access on_corpse_spawned to be able to interact directly with the corpse entity/event itself.
on_corpse_spawned
-
- Fast Inserter
- Posts: 129
- Joined: Mon Dec 18, 2017 7:53 am
- Contact:
Re: on_corpse_spawned
What do you want to do with the corpse?
-
- Fast Inserter
- Posts: 129
- Joined: Mon Dec 18, 2017 7:53 am
- Contact:
Re: on_corpse_spawned
I've written a corpse removal script for Redmew, some of their maps have an insane amount of biters, all of which end up with a corpse when they die.
I was hoping to interact with the corpse spawning, rather than on_entity_died.
I was hoping to interact with the corpse spawning, rather than on_entity_died.
Re: on_corpse_spawned
Just change the time to live or whatever its called on the corpse prototype.
Except its redmew so i'm guessing their self-imposed unnecessary rules prevent them from doing that.
Regardless, this event would double the number of events on death, for very few (if any) use cases. It wouldn't be the most intense thing overall, but it seems unlikely.
Except its redmew so i'm guessing their self-imposed unnecessary rules prevent them from doing that.
Regardless, this event would double the number of events on death, for very few (if any) use cases. It wouldn't be the most intense thing overall, but it seems unlikely.
-
- Fast Inserter
- Posts: 129
- Joined: Mon Dec 18, 2017 7:53 am
- Contact:
Re: on_corpse_spawned
Yes, unfortunately there is the softmod limitation in the implementation side of this current script.
All good, my current script works, I was simply hoping to streamline it a little.
All good, my current script works, I was simply hoping to streamline it a little.
Re: on_corpse_spawned
It would make more sense to me to just include the corpse in `on_post_entity_died`:
https://lua-api.factorio.com/latest/eve ... ntity_died
https://lua-api.factorio.com/latest/eve ... ntity_died
-
- Fast Inserter
- Posts: 129
- Joined: Mon Dec 18, 2017 7:53 am
- Contact:
Re: on_corpse_spawned
That would be cleverer.
Thanks.
Thanks.
Re: on_corpse_spawned
I added an array of the corpses in on_post_entity_died as Klonan suggested (I have source access). It will be in the next version of 0.17.