Event.on_entity_collision

Things that we aren't going to implement
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Event.on_entity_collision

Post by Earendel »

on_entity_collision

Called when a car or train collides with another entity

contains:

entity_a: LuaEntity the entity instigating the collision (a vehicle)
entity_b: LuaEntity the entity being hit (can be a vehicle or other sort of entity) or nil
tile_b: LuaTile the tile being hit or nil

Either entity_b or tile_b should be populated.

In a collision between two vehicles entity_a or entity_b could be either vehicle, entity_a is probably whichever one gets processed first.
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 716
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: Event.on_entity_collision

Post by Earendel »

Those won't do the same thing. When you collide with a tile (like a water tile) you take no damage. If you have 100% impact resistance you take no damage when you crash.
on_entity_collision would allow you to detect a collision without requiring that collision to deal damage (which is desirable with automated vehicles).
Post Reply

Return to “Won't implement”