Request: combat-robots type additions

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

Request: combat-robots type additions

Post by Adil »

Currently entities of type "combat-robot" don't raise event on their destruction. In my currently developed mod it'd be useful to detect when such entities are no more.
Also, there's no way to access their remaining lifetime, at least reading access would be good.
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.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: Request: combat-robots type additions

Post by kyranzor »

Is it possible to override the death event in the robot entity definition so that it triggers a custom event I'D which you can attach a custom event handler to?

By death event I mean the action which occurs when they die and triggers things like explosions etc

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

Re: Request: combat-robots type additions

Post by Adil »

It is possible to have a trigger_created_entity spawned as a death explosion. This is how DroneHome mod works currently.
However, I'd like to have an access to the entity itself prior its death bur by the time trigger_created_entity event is risen the robot entity becomes invalid. (Albeit it can till be found by find_entities_filtered(). )
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.

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Request: combat-robots type additions

Post by Bilka »

See LuaEntity.time_to_live and on_combat_robot_expired.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented mod requests”