Page 1 of 1

Events: on_entity_damaged and on_entity_repaired

Posted: Sun Sep 20, 2015 5:03 pm
by Narc
Could possibly be a single event with negative damage for repairs, but it would certainly make a few more things possible.

Probably would have (beyond the basic event stuff):
  • event.entity -- the entity that was just damaged/repaired
  • event.damage -- the amount of damage that was just dealt
  • event.damage_source -- the entity that dealt the damage/did the repair, if one exists

Re: Events: on_entity_damaged and on_entity_repaired

Posted: Sun Sep 20, 2015 5:07 pm
by orzelek
Wouldn't event like that cause a lot of lag?
Especially with machine guns and similar fast firing weaponry.

Re: Events: on_entity_damaged and on_entity_repaired

Posted: Sun Sep 20, 2015 5:57 pm
by Adil
Well, there is on_trigger_created_entity event which is only called for entities specially declared to raise that event.
Something similar might be used here. Maybe the timeout variable could be implemented as well, so that a single entity couldn't raise the same event on every tick.