Thread: move()
View Single Post
  #1  
Old 05-28-2007, 09:16 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
move()

PHP Code:
function onMovementFinished()
{
  
temp.newx vecx(this.dir) * this.walkspeed;
  
temp.newy vecy(this.dir) * this.walkspeed;
  
this.runcounter--;
  
  if (
this.runcounter 0)
  {
    
setcharani("walk"NULL);
    
    
temp.testx this.temp.newx 1.5 vecx(this.dir);
    
temp.testy this.temp.newy 2.0 vecy(this.dir);
    
    if (
onwall(temp.testxtemp.testy))
    {
      
this.dir = (dir 2) % 4;
      
this.runcounter int(random(060));
      
      
this.onMovementFinished();
    }
      else
    {
      
dist = (temp.newx temp.newy 2) ^ 0.5;
      
move(temp.newxtemp.newydist 168);
    }
  }
    else
  {
    
this.runcounter int(random(1040));
    
    
setcharani("idle"NULL);
    
this.dir = (dir int(random(02)) * 2) % 4;
    
    
this.onMovementFinished();
  }
  
  if (
this.runcounter <= 0)
  {
    
this.runcounter 20;
  }

The movement on this is very.. well, the gani is wierd. Unsure why, I tried messing with it. If someone could help, much appreciated.

P.S. Yeah, I basically rescripted offline movement to GS2 with move(). And yeah, anyone could use this script for there own server.. assuming it worked correctly =[.
__________________
- Zidane / Zidaya
Reply With Quote