Okay, I am doing a relatively simple 16x16 grid movement, but I have run into a problem when it comes to the AI. My current collision detection for the AI sometimes knocks the NPC off the grid.
I have an easy fix in mind, but I don't know how to execute it.
If I could check if the NPC's current x position and y position is divisible by 16, I will be able to work it out from there.
My question is this: How can I test to see if a value is divisible by 16 in MMF2?
It seems by all logic that the mod formula should have worked, but when I implemented it, it caused erratic movement for a reasons I didn't feel like investigating.
What I ended up using was something like this:
X("npc")/16.0 > Int(X("npc")/16) --> do stuff
So basically, comparing the decimal result to the rounded down result. When there isn't decimals, the numbers are equal, meaning it's divisible by 16. When there is decimals, the decimal result is always a larger amount than the rounded down integer.