Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / pathfinding in 3D (using IanM's codebase entry)

Author
Message
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 23rd Dec 2003 08:10
I worked for hours and hours working on IanM's codebase entry to make it more RTS style in camera movement, and positioning objects. Now, you can select a unit(all of them select for some reason), and then rightClick the position you want it to go to and it will move avoiding obstecals!

CODE IN SOURCE CODE BUTTON

Be happy, tomorrow is another day
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Dec 2003 08:43
You might want to double check your code. There's a remend without a remstart. some functions aren't in there.
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 23rd Dec 2003 09:11 Edited at: 23rd Dec 2003 09:13
Sorry, here it is!


Be happy, tomorrow is another day
Atreides
21
Years of Service
User Offline
Joined: 11th Oct 2003
Location: Switzerland (but NOT on a mountain !)
Posted: 23rd Dec 2003 13:19
I don't understand how it works, but it works ^^
it's a nice one Genius

The sleeper must awaken !
Rennekon
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 23rd Dec 2003 13:34
Wow!! thats awesome! I can't figure it out but I could sure use it!

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 23rd Dec 2003 17:43 Edited at: 23rd Dec 2003 17:48
Go ahead and use it if you want!
All you have to do is call a single function to move the object:


this is the only part of the whole thing you need to understand. It took me days on end to convert 2D to 3D. All you have to do is change the:
for f=101 to 111
to whatever objects you want to have find a path. And, another important thing, whenever you make something(building,unit, ect.) you need to setSearchMap(xTile,zTile,flag) to show that that part of the grid is taken so it needs to avoid it. The flage values are 0 is empty, <0 is used.
hope i have helped.

Be happy, tomorrow is another day
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Dec 2003 23:45
It doesn't like it when you tell it to move to a bad spot.
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 24th Dec 2003 00:07
What does it do?

Be happy, tomorrow is another day

Login to post a reply

Server time is: 2024-11-23 23:47:17
Your offset time is: 2024-11-23 23:47:17