1 registered members (1 invisible),
1,143
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
3D point and click pathfinding
#123752
04/14/07 03:27
04/14/07 03:27
|
Joined: Jul 2006
Posts: 91 Florida, USA
Knuckles
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2006
Posts: 91
Florida, USA
|
Hello, I have been working with the program for a while now, and I'm totally catching on to this rather quickly ![](/ubbthreads/images/graemlins/laugh.gif) I've been trying to work on this movement code specifically, and code it in different parts. First, I just want the entity to move to the spot the mouse is clicked in the area (basically teleporting there, not really running along a path yet). this is what I have so far, but it's not really working right. the entity doesn't go to the same spot you click on -- it ports to various places on the map whenever you click the left button: Code:
if(mouse_left == 1) // mouse_left = Left mouse button { heru.x = mouse_cursor.x; heru.y = mouse_cursor.y; heru.z = mouse_cursor.z; }
Now when I get ready to implement the A* pathfinding script, would I call a function from within here?
Last edited by Knuckles; 04/14/07 03:27.
|
|
|
Re: 3D point and click pathfinding
[Re: Knuckles]
#123753
04/14/07 03:53
04/14/07 03:53
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
mouse_cursor returns screen corrdinates
There's a thread around here somewhere that's covered this same thing...
xXxGuitar511 - Programmer
|
|
|
Re: 3D point and click pathfinding
[Re: Knuckles]
#123760
04/15/07 22:06
04/15/07 22:06
|
Joined: Jul 2006
Posts: 91 Florida, USA
Knuckles
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2006
Posts: 91
Florida, USA
|
ok, I don't quite understand how to implement this action script in my code. I created a new entity for the "pointer MDL" that it was calling for: Code:
pointerMDL.z+=10;
However, I don't know how I would call this. Would the action be called once the left mouse button is clicked?
|
|
|
|