Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-18-2012, 03:01 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
simple movement

im trying to set a simple movement within a level area but it keeps heading up to the top of the gmap instead of staying in the level and doing the random movements.
PHP Code:
function onCreated(){
  
showcharacter();
  
setcharani ("ghostani",NULL);
  
dontblock();
  
this.speed 8;
  
this.options 8+16;
  
startmove();
}
function 
startmove() {
  
this.newx=random(1,63);
  
this.newy=random(1,63);
  
dx=(this.newx-x);
  
dy=(this.newy-y);
  
this.distance = ((this.newy-y)^2+(this.newx-x)^2)^.5;
  
this.time = (this.distance/this.speed);
  
move(dx,dy,this.time,this.options);
}
function 
onMvementFinished) {
  
startmove();

__________________
account was being used by jigga.... sorry for what he has said in the past
Reply With Quote
 


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 03:36 AM.


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