Problem description:I'm trying to use step_to for an object to constantly be ontop of you. using 0 as the min size makes them halt one tile next to you. Are there any ways to make something constantly want to be ontop of you, not next to you? Should I be using a different proc? |
Mar 27 2015, 7:22 am
|
|
Any particular reason it's not an overlay?
|
Sorry, I'll rephrase a little. It's an AI that uses step_to to track. The AI only does damage when it's ontop of the person. In the Bump(), I have it set to make it's location the same as the targets. The problem is, it halts before it can Bump() since step_to halts as soon as you're next to them.
|
Micdogmic wrote:
Sorry, I'll rephrase a little. It's an AI that uses step_to to track. The AI only does damage when it's ontop of the person. In the Bump(), I have it set to make it's location the same as the targets. The problem is, it halts before it can Bump() since step_to halts as soon as you're next to them. Are you sure you don't want walk_to or walk_towards? (_to is the pathfinding one that apparently uses up a lot of CPU. walk_towards just goes in their direction but doesn't take obstacles in to account). step_ anything needs to be called continuously. Meaning, that halt you are experiencing... It's probably because you're not calling it multiple times. |
It's being called in a loop every second or so. It only stops when it gets right next to you.
|
Then check for distance. get_dist(). If the distance is 0 (or 1 since I don't know if it counts as 1 when they're not on the same tile), perform your bump stuff. Also, I'm sure there's a way that makes them bump because they bump in my project. It would take some looking up on your part if you still want that method though.
|