Combat robots life management

Post Reply
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Combat robots life management

Post by Adil »

When combat robots' lifetime runs out, they die but do not raise an event. Well, I'm making a mod that would benefit if they did as I want to differentiate between robots dying in battle and those dying of natural causes.

Also, there's no way to access their time_to_live .
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Combat robots life management

Post by Nexela »

entity.time_to_live is now read/write for following robots also, player.following_robots will return a list of following robots following the character

I believe on_entity_died should be raised when following robots are killed by entities. However it might make sense to have following_robots that expire due to TTL raise on_entity_died as well.

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

Re: Combat robots life management

Post by Rseding91 »

I added an event for combat robots expiring for 0.16.

It's called anytime the robot is removed due to a lack of energy, the time running out, or the player throwing new robots to replace old ones.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Implemented mod requests”