Page 1 of 1

Request: combat-robots type additions

Posted: Sun Apr 03, 2016 12:59 am
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.

Re: Request: combat-robots type additions

Posted: Fri Apr 15, 2016 7:07 am
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

Re: Request: combat-robots type additions

Posted: Fri Apr 15, 2016 7:27 am
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(). )

Re: Request: combat-robots type additions

Posted: Mon Oct 07, 2019 8:30 am
by Bilka
See LuaEntity.time_to_live and on_combat_robot_expired.