Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 527 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
3D point and click pathfinding #123752
04/14/07 03:27
04/14/07 03:27
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline 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

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 Offline
Expert
xXxGuitar511  Offline
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: xXxGuitar511] #123754
04/14/07 04:07
04/14/07 04:07
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
so will I need to use mouse_pos instead?

I'll check again, but I don't believe I saw the thread that discused this

Re: 3D point and click pathfinding [Re: Knuckles] #123755
04/14/07 04:26
04/14/07 04:26
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
no...


xXxGuitar511
- Programmer
Re: 3D point and click pathfinding [Re: xXxGuitar511] #123756
04/14/07 10:02
04/14/07 10:02
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
only you need is two vectors, vec_from and vec_to
bu if you has a isometric view, you'll need vec_for_screen to create destination vector.


Never say never.
Re: 3D point and click pathfinding [Re: tompo] #123757
04/14/07 14:17
04/14/07 14:17
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck

Re: 3D point and click pathfinding [Re: Xarthor] #123758
04/14/07 15:54
04/14/07 15:54
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Not the thread I was thinking of, but even better!


xXxGuitar511
- Programmer
Re: 3D point and click pathfinding [Re: xXxGuitar511] #123759
04/14/07 16:54
04/14/07 16:54
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline OP
Junior Member
Knuckles  Offline OP
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
Thank you for this! I will check it out

And no, my game isn't isometric view, however you can move the camera around.

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 Offline OP
Junior Member
Knuckles  Offline 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?

Re: 3D point and click pathfinding [Re: Knuckles] #123761
04/15/07 22:20
04/15/07 22:20
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
On_mouse_left function();


Never say never.
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1