My search fu is failing me.
I'm trying to find the best way to trigger a function when one entity enters a space. Is the only way to do this through the on_tick event? I'm making a Railroad Tunnel mod, and I need to know when a train gets close to a tunnel. I would prefer not to have to implement my own collision detection algorithm in an effort to reduce computation time.
Entity Enters area
-
- Fast Inserter
- Posts: 109
- Joined: Sat Apr 29, 2017 11:13 pm
- Contact:
-
- Fast Inserter
- Posts: 127
- Joined: Fri May 08, 2015 2:25 pm
- Contact:
Re: Entity Enters area
I'd take a look at Factorissimo 2, since it teleports you when you get close to the entrance of the building.
My RSO+Bob's+Angel's modpack: Farlands (outdated)
Mods (current): Resource Labels
Mods (old): Biter Spires
Mods (current): Resource Labels
Mods (old): Biter Spires
-
- Fast Inserter
- Posts: 109
- Joined: Sat Apr 29, 2017 11:13 pm
- Contact:
Re: Entity Enters area
I took at factorissimo and the author does in fact use the on_tick event. In that case, there's just 1 entity to check against X factories. I may end up with N trains comparing against M tunnels, an operation that could get messy quickly. >.>