Entity Enters area

Place to get help with not working mods / modding interface.
Post Reply
FrodoOf9Fingers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sat Apr 29, 2017 11:13 pm
Contact:

Entity Enters area

Post 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.

Pandemoneus
Fast Inserter
Fast Inserter
Posts: 127
Joined: Fri May 08, 2015 2:25 pm
Contact:

Re: Entity Enters area

Post by Pandemoneus »

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

FrodoOf9Fingers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sat Apr 29, 2017 11:13 pm
Contact:

Re: Entity Enters area

Post 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. >.>

Post Reply

Return to “Modding help”