Page 1 of 1

Entity Enters area

Posted: Mon Jun 05, 2017 12:49 am
by FrodoOf9Fingers
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.

Re: Entity Enters area

Posted: Mon Jun 05, 2017 11:32 am
by Pandemoneus
I'd take a look at Factorissimo 2, since it teleports you when you get close to the entrance of the building.

Re: Entity Enters area

Posted: Mon Jun 05, 2017 11:10 pm
by FrodoOf9Fingers
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. >.>