walk_towards(Ref,Trg,Lag=0,Speed=0)
Problem description:
First: Is there a proc similar to walk_towards(Ref,Trg,Lag=0,Speed=0)
where I can tell my object to walk_towards an object's exact pixel location with regards to the tile it is on?
Second: If there isn't one...how would I do this?
Lets say I click a spot on the map and well ..the basics of the map are 32x32 so within each turf tile is 32 pixels in which I could have clicked...
Now that I have clicked tile number 3 at exactly its top right hand pixel point
I want this object to move to that tile but also at it's exact pixel point.
I figured out how to get it to move to the tile and for the click to tell me what pixel position on which tile is being clicked but
not sure what to do from there.
Preferably, I want it to move on a straight path from the client straight to the exact spot click
You can probably use get_step_to or get_step_towards (depending if you want to consider obstacles) to get to the turf you want to be on and from there use my method to walk inside the turf.
We'll start by defining a point datum that will keep track of pixel position, I'll also define a distance function so that we can tell the precise distance between two points.
Now let's grab the point of the click, we'll define a pixel destination point then tell the player to go there.
(I'm using world.icon_size which in your case is 32)
Now all we have to do is define our move_to proc where we'll check the angle we need to move to and just call Move().
And here's get_angle()
There's probably things to improve/modify with this, don't just blindly add it in, for example move_to won't cancel with new move_to calls so if you've clicked a second target you have to cancel the previous move_to() but all that should be relatively easy, bump this with questions if you have any.
Alternatively to the whole method I wrote above you can just try creating a temporary target object located at precise x,y,z step_x, step_y of the click on the turf and using walk_towards to that object.
You might even want to attach a nice animated image to it like arrows or a circle similar to how it is in league of legends or RTS games, up to you!