Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #41  
Old 08-29-2007, 01:13 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
function checkPath(oxtxoyty) {
  
temp.nxy = {(tx 23.5/16) - (ox 23.5/16)
              (
ty 31.5/16) - (oy 31.5/16)};
  
temp.dist = (nxy[0]*nxy[0] + nxy[1]*nxy[1])^0.5;
  
temp.ow false;
  
  for(
temp.0dist++) {
    if (
onwall2((ox 23.5/16) + ((nxy[0]/dist) * i),
       (
oy 31.5/16) + ((nxy[1]/dist) * i), 0.50.5)) {
      
ow true;
      break;
    }
    
++;
  }
  return 
ow;

wee
__________________
Reply With Quote
  #42  
Old 08-30-2007, 12:20 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Twinny View Post
I set up nodes all over my gmaps while using dynamic a* to navigate between nodes. I figured that using a* for a whole gmap would quickly set fire to the NPC-Server .
Perhaps a system could be created to transfer complex calculations to a single client that has the NPC loaded and the calculating client would shift between the various clients that have it loaded, and fall back on the NPC-Server if none have it loaded.

Just a thought.
__________________
Reply With Quote
  #43  
Old 12-25-2007, 01:11 AM
Rapidwolve24 Rapidwolve24 is offline
North*
Join Date: Oct 2007
Location: Massachusetts
Posts: 178
Rapidwolve24 is on a distinguished road
Send a message via AIM to Rapidwolve24 Send a message via MSN to Rapidwolve24
I know I'm a little late but wouldnt something like this do the trick

PHP Code:
public function CheckPath(xydxdy)
{   
   
temp.check 0;
   
temp.checkrate 1;
   
   
temp.distance distance(xydxdy);
   
temp.angle getangle(dx xdy y);
   
   while (
temp.check temp.distance)
   {
     
temp.checkx int(+ (temp.check cos(temp.angle)));
     
temp.checky int(+ (temp.check * -sin(temp.angle)));
     
     if (
onwall(temp.checkxtemp.checky))
     {
        
temp.onwallcounter += 1;
     }
   
     
temp.check += temp.checkrate;
     
     
sleep(0.05);
   } 
  return 
temp.onwallcounter;

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:03 AM.


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