on_corpse_spawned

Post Reply
EnigmaticAussie
Fast Inserter
Fast Inserter
Posts: 129
Joined: Mon Dec 18, 2017 7:53 am
Contact:

on_corpse_spawned

Post by EnigmaticAussie »

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.

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: on_corpse_spawned

Post by Boodals »

What do you want to do with the corpse?

EnigmaticAussie
Fast Inserter
Fast Inserter
Posts: 129
Joined: Mon Dec 18, 2017 7:53 am
Contact:

Re: on_corpse_spawned

Post by EnigmaticAussie »

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.

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: on_corpse_spawned

Post by Boodals »

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.

EnigmaticAussie
Fast Inserter
Fast Inserter
Posts: 129
Joined: Mon Dec 18, 2017 7:53 am
Contact:

Re: on_corpse_spawned

Post by EnigmaticAussie »

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.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: on_corpse_spawned

Post by Klonan »

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

EnigmaticAussie
Fast Inserter
Fast Inserter
Posts: 129
Joined: Mon Dec 18, 2017 7:53 am
Contact:

Re: on_corpse_spawned

Post by EnigmaticAussie »

That would be cleverer.

Thanks.

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: on_corpse_spawned

Post by Boodals »

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.

Post Reply

Return to “Implemented mod requests”