Collision based AI trigger (/AITrigger)

by Tafe
Manage CPU usage by using bounds and collision detection to trigger AI [More]

Currently Unavailable

Version 1
Date added: Jun 3 2019
Last updated: Jun 4 2019
3 fans


Tafe: (Jun 5 2019, 9:59 am)
Somehow, the movement in ResetState() gets stuck in a loop, and isn't properly calculated to move towars home_loc. the distance is greater than 0, but yet he stops moving and continues the movement loop.

The location is saved as a turf, which is 32x32 while Monster is moving 2 steps. So it is probably a conflict between tile size and step size
Tafe: (Jun 5 2019, 9:33 am)
Forsome oddball reason, it wasn't working correctly durring ResetState. Bugs the crap out of me when i make something work, copy it into an empty project. now it doesn't work anymore.

Working on a fix.
Nadrew: (Jun 4 2019, 8:44 pm)
One thing you do need to add is type checking in your Crossed(), having


Doesn't actually assure that the argument is in fact a mob, just like Entered(). You'll want an ismob() there otherwise mobile objects will also trigger your monsters.
Nadrew: (Jun 4 2019, 4:42 pm)
I threw one out on Discord a while ago but never really bothered to properly turn it into a hub entry. It's still sitting on my Google drive.
Tafe: (Jun 4 2019, 4:40 pm)
Nadrew wrote:
Been using this method a while myself, it's probably one of the most efficient ways you can pull this off on BYOND.

Yes, I agree. I honestly thought it was weird how i couldn't find other libraries or demos for this, so i simply couldn't stop myself from making one.