ID:156600
![]() Aug 29 2010, 9:07 pm
|
|
As the Topic says. How do I make the mob face the mouse wherever the mouse is pointing. So if I'm walking north and moving my mouse south-east, my character will face the mouse walking north still. If you understand what I mean
|
I know how to make the mob move with clicks. But I just didn't know if it was possible to make the mob face the mouse at all times without making it tape a step
|
well you could do something like this
client/North(){mob.Move(get_step(mob,NORTH), mob.dir)} then you could use MouseOver() proc in turfs to change the mobs direction to the turf the mouse passed over(use get_dir()). well hope that helps |
I got it working with MouseEntered() and get_dir O.o thanks for the tip on get_dir don't know why I didn't think of it
|
new problem. How do I make a separate Icon follow mouse WHILE the mob is moving with the normal icon.
ex: the mob is going north so the Movement states are active. But I wanna move my mouse down south. so the head turns south while body is still walking north without it being affected |
You if you want to move with MouseEntered() and you want to face the mouse with the same procedure... yeah, it is impossible because of this:
- MouseEntered, walk North; face north - MouseEntered, walk Northeast; face northeast - etc The only way this would work independently is if you had two different methods For example, make the user START/STOP walking by clicking a /turf - in which they'll walk to the DIRECTION (not the location!) where you clicked. That way, it frees up MouseEntered() for the mob facing. |
GhostAnime wrote:
"... impossible ..." Virtually nothing is impossible. The easiest way to get this done would make the main /mob or player the bottom of the icon, or the legs. Then have something like an /obj keep a constant location on top of the /mob or player, and have said /obj's direction face the direction in MouseEntered(). The legs will continue their normal operation of direction so North is North, but the upper portion will face the Mouse. |
Maximus_Alex2003 wrote:
GhostAnime wrote: I guess I should have said in the first sentence that the same method instead of the same procedure. Though you should have read my sentence a bit more carefully; I thought that the person moved via MouseEntered(), which is not the case when I looked back just now. I never said it was impossible to have the legs in one direction and a face in another, what I was trying to say is that it is impossible to make a person move in one direct and face another when using the same method (which means no differentiation between when to walk and when to face). |
Masschaos100 wrote:
well you could do something like this > client/North(){mob.Move(get_step(mob,NORTH), mob.dir)} then you could use MouseOver() proc in turfs to change the mobs direction to the turf the mouse passed over(use get_dir()). well hope that helps Move(NewLoc, Dir) dir is the direction the mob will face while moving O-O |
I have seen this work on flash before.
I guess I'll figure it out myself. O.o thought about overlays but didn't know if that would work right |
BYOND doesn't even close to matching Flash's functionality, especially when it comes to graphical manipulation.
|
You can although make a mob move using mouseclicks and make it move in the direction of the click