Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   findpathinarray (https://forums.graalonline.com/forums/showthread.php?t=77823)

DustyPorViva 12-05-2007 07:06 AM

findpathinarray
 
I'm pretty curious... could anyone explain this function and its parameters?

Quote:

findpathinarray(obj, obj, obj, obj, obj, int, int, int) - returns object - simple pathfinding; parameters are a two-dimensional array ('tiles'):
tiles were we are allowed to walk
tiles where we are not allowed to walk
tiles where we may stop
tiles where we should not stop
start x and y
maximum path length

Kyranki 12-05-2007 07:20 AM

I have never seen that before. o_O

coreys 12-05-2007 04:17 PM

o_o
woah...

Novo 12-05-2007 06:43 PM

Umm... Well, I get the syntax and all... But... How do we decide the final destination? Doesn't make sense.

Crow 12-05-2007 07:31 PM

Quote:

Originally Posted by Novo (Post 1362277)
Umm... Well, I get the syntax and all... But... How do we decide the final destination? Doesn't make sense.

"tiles where we may stop" <-- Those tiles maybe?

Novo 12-06-2007 12:10 AM

Quote:

Originally Posted by Crow (Post 1362283)
"tiles where we may stop" <-- Those tiles maybe?

If such is true... Then...

PHP Code:

allowedToWalk = new[level.width][level.height];
notAllowedToWalk = new[level.width][level.height];
allowedToStop = new[level.width][level.height];
tileShouldNotStop = new[level.width][level.height];
tileShouldStop = new[level.width][level.height];
tileShouldStopdest.xdest.] = 1;
for ( (
every tile in level) as tile)
  {
    
allowedToWalktile.xtile.] = !onwalltile.xtile.);
    
notAllowedToWalktile.xtile.] = onwalltile.xtile.); // Eh? Isn't this implicit from the last param?
    
tileShouldNotStoptile.xtile.] = !tileShouldStop[tile.xtile.y]; // Implicit?
  
}

findpathinarray(allowedToWalknotAllowedToWalktileShouldStoptileShouldNotStopIdontKnowstartXstartY100); 

That would be my best guess at the syntax. Though, I have done zero attempt to confirm this, and there is a Parameter that I am unsure about. ( This is pseudo-code. )


All times are GMT +2. The time now is 10:18 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.