ID:267696
 
A while ago, Lummox JR said that people can customise Deadron's base_StepTowards() with cardinal stuff. How exactly do you do that?

~~ Dragon Lord ~~
Anyone know?
In response to Unknown Person
nope i have no idea sorry
What do you mean, exactly? Do you want to restrict movement to morth/south/east/west or something?
In response to Crispy
I want to restrict non-cardinal directions. (EG: Northwest, southwest)
In response to Unknown Person
Lummox JR said it was possible to customise Deadron's PathFinding library. I just don't know how.

PS: This is a bump.
In response to Unknown Person
So, after all of this time, when Lummox JR said that Deadron's PathFinding library's procedure was able to be customised so it won't step in non-cardinal directions, nobody answers?

PS: Bump
In response to Unknown Person
Unknown Person wrote:
So, after all of this time, when Lummox JR said that Deadron's PathFinding library's procedure was able to be customised so it won't step in non-cardinal directions, nobody answers?

PS: Bump

I'll try to look at it...I'll be doing the same thing you could try, which is looking at the source. In spite of many comments, though, I know it isn't the most readable source around.
In response to Unknown Person
If you're simply trying to keep people from walking NE, SE, etc, you can override the client procs.

client
Northeaset()
return
Northwest()
return
Southeast()
return
Southwest()
return


Also, you could try stopping it in the atom/movable/Move() proc like so. I'm assuming that you just want the atom to
end up in the diagonal, just taking a different route to get there:
atom/moveable
Move(newloc, dir)
if(dir == NORTHEAST)
step(NORTH)
step(EAST)
return
if(dir == NORTHWEST)
step(NORTH)
step(WEST)
return
//...etc etc etc
..() // be sure to move normally if it's a cardinal direction to begin with


If I was mistaken and you simply want to prevent movement in those directions, you could check for the 'dir' in a list.

Hope that helped. I know it's not overriding deadron's proc, but if the above will work, I'd use that and leave his stuff alone.
I haven't tried any of that, but it should work. Let me know if you have any questions.
In response to sapphiremagus
Thanks, I have been waiting for answer like that. =) But one more question, what do you mean by:

If I was mistaken and you simply want to prevent movement in those directions, you could check for the 'dir' in a list.

And how do I do it?

Thanks for the previous answer.

~~ Dragon Lord ~~


PS: Northeast and movable are spelt wrong. >.>
In response to sapphiremagus
sapphiremagus wrote:
Hope that helped. I know it's not overriding deadron's proc, but if the above will work, I'd use that and leave his stuff alone.

That solution won't work when using the pathing library...it'll just get mobs/players stuck and unable to move.