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
  #1  
Old 01-22-2008, 09:40 PM
Dan Dan is offline
Daniel
Join Date: Oct 2007
Posts: 383
Dan is an unknown quantity at this point
Send a message via MSN to Dan
I've had the same problem, though maybe this can help (since it did for me);

PHP Code:
temp.dx this.path[this.pathpos][1] - this.x;
temp.dy this.path[this.pathpos][2] - this.y;
temp.dist = (dx dy 2) ^ 0.5;
if (
abs(temp.dist) <= 0.5) {
  
this.+= temp.dx;
  
this.+= temp.dy;
  
setPathPos(this.pathpos 1);
  
dropPresent(); // Chooses wether to drop or not drop a gift
  
setCharAni("zone2_idle","");
}
else {
  if (
temp.dist temp.speed) {
    
temp.dx *= temp.speed temp.dist;
    
temp.dy *= temp.speed temp.dist;
    
temp.dist temp.speed;
  }
  else {
    
timegap max(0.1,temp.dist temp.speed);
  }
  
move(temp.dx,temp.dy,timegap,16);

(use 'setTimer(timegap);')
(source; my Santa script for Zone)
__________________
Reply With Quote
  #2  
Old 01-22-2008, 11:29 PM
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 Dan View Post
I've had the same problem, though maybe this can help (since it did for me);

PHP Code:
temp.dx this.path[this.pathpos][1] - this.x;
temp.dy this.path[this.pathpos][2] - this.y;
temp.dist = (dx dy 2) ^ 0.5;
if (
abs(temp.dist) <= 0.5) {
  
this.+= temp.dx;
  
this.+= temp.dy;
  
setPathPos(this.pathpos 1);
  
dropPresent(); // Chooses wether to drop or not drop a gift
  
setCharAni("zone2_idle","");
}
else {
  if (
temp.dist temp.speed) {
    
temp.dx *= temp.speed temp.dist;
    
temp.dy *= temp.speed temp.dist;
    
temp.dist temp.speed;
  }
  else {
    
timegap max(0.1,temp.dist temp.speed);
  }
  
move(temp.dx,temp.dy,timegap,16);

(use 'setTimer(timegap);')
(source; my Santa script for Zone)
So how is that fixing the problem?
__________________
Reply With Quote
  #3  
Old 01-23-2008, 01:11 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
So how is that fixing the problem?
From what I can see it moves it every timegap a certain amount, versus moving a large amount at once?
__________________
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 06:56 AM.


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